cmake_minimum_required ( VERSION 3.8.1)

PROJECT(bjTick)

set(CMAKE_BUILD_TYPE Debug)
#判断编译器类型,如果是gcc编译器,则在编译选项中加入c++11支持
#if(CMAKE_COMPILER_IS_GNUCXX)
    #add_compile_options(-std=c++11)
    #message(STATUS "optional:-std=c++11")   
#endif(CMAKE_COMPILER_IS_GNUCXX)

set(CMAKE_CXX_COMPILER      "g++" )         # 显示指定使用的C++编译器

set(CMAKE_CXX_FLAGS   "${CMAKE_CXX_FLAGS} -std=c++11")             # c++11
message(STATUS "optional: -std=c++11")

set(CMAKE_CXX_FLAGS   "${CMAKE_CXX_FLAGS} -g")                     # 调试信息
message(STATUS "optional: add debug symbols")

set(CMAKE_CXX_FLAGS   "${CMAKE_CXX_FLAGS} -Wall")                  # 开启所有警告
message(STATUS "optional: open all warnings")

set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG} -O0" )             # 调试包不优化
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG " )   # release包优化

SET(SRC_LIST main.cpp)

# 增加子目录，子目录里需要有CMakeLists.txt文件
add_subdirectory(global)
add_subdirectory(msg)
add_subdirectory(utils)
add_subdirectory(wnds)
add_subdirectory(cmds)

#下面这个添加宏定义的方式是全局起作用，可以用target_compile_definitions来缩小作用范围
#add_definitions(-D_WIN32_IE=0x0600)
add_definitions(-DUNICODE)

ADD_EXECUTABLE(bjTick WIN32 ${SRC_LIST})

target_compile_definitions(bjTick PRIVATE _WIN32_IE=0x0A00 _WIN32_WINNT=0x0A00)
target_link_libraries(bjTick MsgLib GlobalsDef Utils Wnds Cmds Comctl32 Shlwapi)